package com.treinamento.pdv.connection;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class Connection {

	private EntityManagerFactory emf;
	private static Connection connection;
	
	private Connection(){
	}
	
	public EntityManagerFactory getEntityManagerFactory(){
		if (emf == null){
			emf = Persistence.createEntityManagerFactory("pdv-servicePU");
		}
		return emf;
	}
	
	public static Connection getInstance(){
		if(connection == null) {
			connection = new Connection();
		}
		return connection;
	}
}
